<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>易优名品</title>
    <link rel="stylesheet" href="__LayUI__/css/layui.css">
    <link rel="stylesheet" href="__Admin__/css/admin.scss">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    {include file="layout/head" /}

    {include file="layout/sidebar" /}

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div id="mainContain">
            <form method="post" class="layui-form">
                <table class="layui-table layui-col-xs8">
                    <colgroup>
                        <col width="200">
                        <col width="400">

                    </colgroup>
                    <thead>
                        <tr>
                            <th>名称</th>
                            <th>配置值</th>

                        </tr>
                    </thead>
                    <tbody>
                    <?php foreach ($res as $k=>$v) :?>
                        <tr>
                            <td><?php echo $v['cnname'] ?></td>
                            <td>
                                <?php if ($v['type']==1) :?>
                                <input onkeydown="if(event.keyCode==32||event.keyCode==13){return false;}" class="layui-input" value="<?php echo $v['value']; ?>" type="text" name="<?php echo $v['enname']; ?>">
                                <?php elseif ($v['type']==2) :?>
                                <textarea class="layui-textarea" name="<?php echo $v['enname']; ?>"><?php echo $v['value']; ?></textarea>
                                <?php elseif ($v['type']==3) :
                                    if($v['values']){
                                        $arr=explode(',',$v['values']);
                                    }  
                                    foreach ( $arr as $k1=>$v1 ):
                                ?>
                                <input   class="layui-input" type="radio"  <?php if($v['value']==$v1) echo "checked= 'checked' " ?> value="<?php echo $v1; ?>" name="<?php echo $v['enname']; ?>" /> <?php echo $v1 ;?>
                                <?php endforeach ; ?>
                                <?php elseif ($v['type']==4) :
                                    if($v['values']){
                                        $arr2=explode(',',$v['values']);
                                    }
                                ?>
                                <select  id=""  name="<?php echo $v['enname']?>" >
                                <?php foreach($arr2 as $k2=>$v2) :?>
                                    <option  value=" <?php echo $v2?> "  <?php $vn=preg_replace('#\s|\r|\n|\t#','',$v["value"]); $vn2=preg_replace('#\s|\r|\n|\t#','',$v2); if($vn==$vn2)  echo "selected" ?>  > <?php echo $v2?> </option>
                                <?php endforeach;?>
                                </select>


                                <?php endif; ?>



                            </td>
                        </tr>
                    <?php endforeach?>

                    </tbody>
                </table>
                <input class="layui-btn layui-btn-normal" type="submit" value="提交">
            </form>
        </div>
    </div>

    {include file="layout/footer" /}

</div>
<script src="__LayUI__/layui.js"></script>
<script>
    layui.use(['element','form'], function(){
        var form = layui.form;
    });
</script>
</body>
</html>